package com.cqeec.util;

import java.sql.DriverManager;
import java.sql.SQLException;

import com.mysql.jdbc.Connection;

/**
 *  数据库连接工具
 * @author 邓学强
 *  数据库：Mysql
 */
public class JdbcUtil {
	
	static String sqlurl ="com.mysql.jdbc.Driver";
	static	String name ="root";//数据库名
	static String paw = "123";//数据库登录密码
	static String jdbc = "jdbc:mysql://127.0.0.1:1314/order?useSSL=false";//数据库为order
   public static  Connection getcon() throws ClassNotFoundException, SQLException{
	   Class.forName(sqlurl);
	 Connection con = (Connection) DriverManager.getConnection(jdbc, name,paw);
	 System.out.println("连接成功");
	  return con;
   }

}
